package com.code.ddbond.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "spring.minio")
@EnableConfigurationProperties(MinioConfig.class)
public class MinioConfig
{
    private String accessKey;
    private String secretKey;
    private String url;
    private String bucketName;
    @Bean
    public MinioClient minioClient()
    {
        return MinioClient.builder().endpoint(url).credentials(accessKey,secretKey).build();
    }
}
